home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
vbpxen
/
custedit.frm
< prev
next >
Wrap
Text File
|
1995-10-23
|
12KB
|
485 lines
VERSION 2.00
Begin Form custedit
Caption = "Customer View/Edit"
ClientHeight = 5130
ClientLeft = 1095
ClientTop = 1485
ClientWidth = 7695
Height = 5535
Left = 1035
LinkMode = 1 'Source
LinkTopic = "Form1"
ScaleHeight = 5130
ScaleWidth = 7695
Top = 1140
Width = 7815
Begin CommandButton ButtonDone
Caption = "E&xIt"
FontBold = -1 'True
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 12
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 615
Left = 6120
TabIndex = 19
Top = 4200
Width = 975
End
Begin CommandButton ButtonDelete
Caption = "&Delete"
Height = 615
Left = 4440
TabIndex = 22
Top = 4200
Visible = 0 'False
Width = 1095
End
Begin CommandButton ButtonCancel
Caption = "&Cancel"
Height = 615
Left = 1920
TabIndex = 21
Top = 4200
Visible = 0 'False
Width = 1095
End
Begin CommandButton ButtonOK
Caption = "&OK"
Height = 615
Left = 360
TabIndex = 20
Top = 4200
Visible = 0 'False
Width = 975
End
Begin CommandButton ButtonNew
Caption = "&Add"
Height = 495
Left = 6120
TabIndex = 18
Top = 3240
Width = 975
End
Begin TextBox Zip
Height = 375
Left = 2160
TabIndex = 6
Text = " "
Top = 2880
Width = 1335
End
Begin TextBox city
Height = 375
Left = 2160
TabIndex = 5
Text = " "
Top = 2400
Width = 3375
End
Begin CommandButton ButtonEdit
Caption = "&Edit"
Height = 495
Left = 6120
TabIndex = 17
Top = 2280
Width = 975
End
Begin TextBox address
Height = 375
Left = 2160
TabIndex = 4
Text = " "
Top = 1920
Width = 3375
End
Begin CommandButton ButtonLast
Caption = "&Last"
Height = 375
Left = 6720
TabIndex = 16
Top = 1560
Width = 735
End
Begin CommandButton ButtonFirst
Caption = "&First"
Height = 375
Left = 5880
TabIndex = 15
Top = 1560
Width = 735
End
Begin TextBox firstname
Height = 375
Left = 2160
TabIndex = 3
Text = " "
Top = 1440
Width = 2055
End
Begin CommandButton ButtonNext
Caption = "&Next"
Height = 375
Left = 6720
TabIndex = 14
Top = 960
Width = 735
End
Begin CommandButton ButtonPrior
Caption = "&Prior"
Height = 375
Left = 5880
TabIndex = 13
Top = 960
Width = 735
End
Begin TextBox lastname
Height = 375
Left = 2160
TabIndex = 2
Text = " "
Top = 960
Width = 2055
End
Begin TextBox custnumber
Height = 375
Left = 2160
TabIndex = 1
Text = " "
Top = 480
Width = 1215
End
Begin CommandButton ButtonFind
Caption = "&Get"
Height = 495
Left = 6120
TabIndex = 11
Top = 240
Width = 975
End
Begin Label total_spent
BorderStyle = 1 'Fixed Single
Caption = " "
Height = 375
Left = 4440
TabIndex = 26
Top = 3480
Width = 1095
End
Begin Label Label8
Caption = "YTD Spent:"
Height = 255
Left = 3120
TabIndex = 25
Top = 3480
Width = 1095
End
Begin Label tapes_out
BorderStyle = 1 'Fixed Single
Caption = " "
Height = 375
Left = 2160
TabIndex = 24
Top = 3480
Width = 855
End
Begin Label Label7
Caption = "Tapes out:"
Height = 255
Left = 720
TabIndex = 23
Top = 3480
Width = 1335
End
Begin Label Label6
Caption = "Zip:"
Height = 255
Left = 720
TabIndex = 10
Top = 3000
Width = 975
End
Begin Label Label5
Caption = "City:"
Height = 375
Left = 720
TabIndex = 9
Top = 2520
Width = 1215
End
Begin Label Label4
Caption = "Address:"
Height = 255
Left = 720
TabIndex = 8
Top = 2040
Width = 1215
End
Begin Label Label3
Caption = "First name:"
Height = 255
Left = 720
TabIndex = 7
Top = 1560
Width = 1335
End
Begin Label Label2
Caption = "Last name:"
Height = 255
Left = 720
TabIndex = 0
Top = 1080
Width = 1335
End
Begin Label Label1
Caption = "Number:"
Height = 375
Left = 720
TabIndex = 12
Top = 600
Width = 975
End
End
Dim iMode As Integer
Dim blankcustrec As CUST
Dim savecustrec As CUST
Const EDIT_MODE = 0
Const ADD_MODE = 1
Const VIEW_MODE = 2
Sub ButtonCancel_Click ()
If iMode = ADD_MODE Then
custrec = savecustrec
rc = GetCustomerRec(DBKEYED)
If rc Then
rc = GetCustomerRec(DBFIRST)
End If
End If
FieldsToForm
SetEditMode VIEW_MODE
End Sub
Sub ButtonDelete_Click ()
'
' check if user pressed OK or CANCEL
'
Msg$ = "OK to delete?"
rc = MsgBox(Msg$, MB_OKCANCEL + MB_ICONQUESTION, "DELETE")
If rc = IDCANCEL Then
SetEditMode VIEW_MODE
Exit Sub
End If
rc = DeleteCustomerRec()
If rc Then
MsgBox "Delete failed, code: " + Str$(rc)
Beep
End If
rc = GetCustomerRec(DBNEXT)
If rc Then
rc = GetCustomerRec(DBLAST)
End If
FieldsToForm
SetEditMode VIEW_MODE
End Sub
Sub ButtonDone_Click ()
Unload custedit
End Sub
Sub ButtonEdit_Click ()
screen.MousePointer = POINTER_HOURGLASS
rc = GetCustomerRecForUpdate()
If rc Then